<?php
/**
 * 后台登陆输入信息
 */
namespace APP\PUT;



class Login extends \SF\Input
{
	public function init()
	{
	    // 用户名
		$this->addItem('email', array(
		    'filters'         => array('stringTrim', 'deQuote'),
		    'validators'	 => array(
		        array('validator'=>'isEmail', 'message'=>'邮箱格式错误')
		    ),
		));
		
		// 密码
		$this->addItem('password', array(
		    'filters'		=> array('stringTrim', 'deQuote'),
		    'validators'	=> array(
		        array('validator'=>'NotEmpty', 'message'=>'密码无效'),
		    ),
		));
		
		// 验证码
		/*
		$this->addItem('captcha', array(
		    'filters'		=> array('stringTrim'),
		    'validators'	=> array(
		        array('validator'=>'NotEmpty', 'message'=>'验证码不能为空'),
		        array('validator'=>'lengthRange', 'options'=>array(4,4), 'message'=>'验证码无效'),
		        array('validator'=>'isEqual', 'options'=>array($_SESSION['captcha']), 'message'=>'验证码无效'),
		    ),
		));
		*/
	}
}